package com.huike.report.mapper;

import java.util.List;
import java.util.Map;

import com.huike.report.domain.vo.DateAndNum;
import com.huike.report.domain.vo.PieChartVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.huike.clues.domain.vo.IndexStatisticsVo;

/**
 * 首页统计分析的Mapper
 * @author Administrator
 *
 */
@Mapper
public interface ReportMapper {
	/**=========================================基本数据========================================*/
	/**
	 * 获取线索数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getCluesNum(@Param("startTime") String beginCreateTime,
						@Param("endTime") String endCreateTime,
						@Param("username") String username);

	/**
	 * 获取商机数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getBusinessNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同数量
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Integer getContractNum(@Param("startTime") String beginCreateTime,
						   @Param("endTime") String endCreateTime,
						   @Param("username") String username);

	/**
	 * 获取合同金额
	 * @param beginCreateTime	开始时间
	 * @param endCreateTime		结束时间
	 * @param username			用户名
	 * @return
	 */
	Double getSalesAmount(@Param("startTime") String beginCreateTime,
						  @Param("endTime") String endCreateTime,
						  @Param("username") String username);



    /**=========================================今日简报========================================*/
	Integer getTodayInfoCluesNum(@Param("username") String username,@Param("date") String date);

	Integer getTodayInfoBusinessNum(@Param("username") String username,@Param("date") String date);

	Integer getTodayInfoContractNum(@Param("username") String username,@Param("date") String date);

	//double getTodayInfoSalesAmount(@Param("username") String username,@Param("date") String date);

	/**=========================================待办========================================*/
	Integer getTodoInfoFollowedCluesNum(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime,@Param("username")String username);

	Integer getTodoInfoFollowedBusinessNum(@Param("beginCreateTime")String beginCreateTime,@Param("endCreateTime") String endCreateTime,@Param("username") String username);

	Integer getTodoInfoCluesNum(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime,@Param("username") String username);

	Integer getTodoInfoBusinessNum2(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime,@Param("username") String username);


	/**=========================================统计学科分布========================================*/
	List<PieChartVO> subjectStatistics(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);


	//查找字典对应字段
	String sysDict(@Param("subject")String subject);

	DateAndNum cluesStatistics(@Param("beginCreateTime") String beginCreateTime,@Param("endCreateTime") String endCreateTime);


}
